﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace POVRay {
    [PRBlock("global_settings")]
    public class GlobalSettings : Block {

        [PRParam("charset")]
        [PRParamIntMap((int)GlobalCharset.System, "sys")]
        [PRParamIntMap((int)GlobalCharset.ASCII, "ascii")]
        [PRParamIntMap((int)GlobalCharset.UTF8, "utf8")]
        public GlobalCharset? Charset { get; set; }

        [PRParam("adc_bailout")]
        public float? ADCBailout { get; set; }

        [PRParam("ambient_light")]
        public Color? AmbientLight { get; set; }

        [PRParam("assumed_gamma")]
        public float? AssumedGamma { get; set; }

        [PRParam("hf_gray_16")]
        public bool? HeightFieldGray16 { get; set; }

        [PRParam("irid_wavelength")]
        public Color? IridescenceWavelength { get; set; }

        [PRParam("max_trace_level")]
        public int? MaxTraceLevel { get; set; }

        [PRParam("max_intersections")]
        public int? MaxIntersections { get; set; }

        [PRParam("number_of_waves")]
        public int? NumberOfWaves { get; set; }

        [PRParam("noise_generator")]
        [PRParamIntMap((int)NoiseGenerator.POV_Ray_3_1, "1")]
        [PRParamIntMap((int)NoiseGenerator.POV_Ray_3_1_RangeCorrected, "2")]
        [PRParamIntMap((int)NoiseGenerator.PerlinNoise, "3")]
        public NoiseGenerator? Noise { get; set; }

        [PRParam()]
        public Radiosity Radiosity { get; set; }

        [PRParam()]
        public GlobalPhotons Photons { get; set; }

        public GlobalSettings() {
        }

        public GlobalSettings(float assumedGamma) {
            AssumedGamma = assumedGamma;
        }

        public override string ToString(int level) {
            return this.POVRayString(level);
        }
    }

    public enum GlobalCharset {
        ASCII,
        UTF8,
        System
    }
}
